package 多线程.复习.线程方法;

public class NewAndRunnableState {
    public static void main(String[] args) {
        Thread thread = new Thread(() -> {
            for (int i = 0; i < 1; i++) {

            }
            System.out.println(Thread.currentThread().getName() + " : " + Thread.currentThread().getState());
        },"子线程");
        System.out.println(thread.getName() + " : " + thread.getState());
        thread.start();
        while (thread.isAlive()){
            System.out.println(thread.getName() + " : " + thread.getState());
        }
        System.out.println(thread + " : " + thread.getState());
    }
}
